package com.xiangban.service.impl;

import com.xiangban.dao.InsuranceMapper;
import com.xiangban.model.Insurance;
import com.xiangban.service.InsuranceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * @Author ly
 * @date 2021/12/28 15:10
 */
@Service
@Slf4j
public class InsuranceServiceImpl implements InsuranceService {
    public static BigDecimal money = new BigDecimal("1");
    @Autowired
    private InsuranceMapper insuranceMapper;
    @Override
    public Object Insurance(Insurance insurance) {
        //将保单信息插入
        //根据订单编号查出所有信息
       Insurance info=   insuranceMapper.selectInfo(insurance);
       info.setMoney(money);
       insuranceMapper.insertInto(info);
        return "ok";
    }
}
